package com.gaussian.property.module.biz.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.gaussian.property.module.biz.entity.ProjectCheckTable;
import com.gaussian.property.module.biz.mapper.ProjectCheckTableMapper;
import com.gaussian.property.module.biz.service.IProjectCheckTableService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.songqi.common.core.constant.Constants;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 项目绑定的稽核表 服务实现类
 * </p>
 *
 * @author songqi(13776346982)
 * @since 2024-04-09
 */
@Service
public class ProjectCheckTableServiceImpl extends ServiceImpl<ProjectCheckTableMapper, ProjectCheckTable> implements IProjectCheckTableService {

    /**
     * 查询项目与稽核表是否绑定
     * @param projectId
     * @param checkTableId
     * @return
     */
    @Override
    public ProjectCheckTable queryProjectCheckTable(String projectId, String checkTableId) {
        LambdaQueryWrapper<ProjectCheckTable> queryWrapper = new LambdaQueryWrapper<ProjectCheckTable>()
                .eq(ProjectCheckTable::getProjectId, projectId)
                .eq(ProjectCheckTable::getCheckTableId, checkTableId)
                .eq(ProjectCheckTable::getStatus, Constants.ENABLE);
        return baseMapper.selectOne(queryWrapper);
    }

}
